package com.kye.express.business.welfare_integral.viewbinder;

import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.kye.express.R;
import com.kye.express.databinding.ItemIntegralCenterListEmptyBinding;
import com.kye.model.bean.integral.IntegralRecordEmptyBean;

import me.drakeet.multitype.ItemViewBinder;

/**
 * @author : Joe
 * @version : 1.0
 * @editor : Joe
 * @created : 12/01/2018
 * @updated : 12/01/2018
 * @description : <Description>
 * @update_reason : <UpdateReason>
 *
 *     积分中心头部item
 */

public class IntegralRecordEmptyItemViewBinder extends ItemViewBinder<IntegralRecordEmptyBean, IntegralRecordEmptyItemViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View view = inflater.inflate(R.layout.item_integral_center_list_empty, parent, false);
        return new ViewHolder(view);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull IntegralRecordEmptyBean item) {
        holder.bindData(item);
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        private IntegralRecordEmptyBean item;
        private ItemIntegralCenterListEmptyBinding binding;

        public ViewHolder(View itemView) {
            super(itemView);
            binding = DataBindingUtil.bind(itemView);
        }

        public void bindData(IntegralRecordEmptyBean item) {
            this.item = item;
            binding.setData(item);
        }
    }

}
